/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronin.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author esimsek
 */
@Entity
@Table(name = "musteri_randevu")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MusteriRandevu.findAll", query = "SELECT m FROM MusteriRandevu m"),
    @NamedQuery(name = "MusteriRandevu.findById", query = "SELECT m FROM MusteriRandevu m WHERE m.id = :id"),
    @NamedQuery(name = "MusteriRandevu.findByRandevuZamani", query = "SELECT m FROM MusteriRandevu m WHERE m.randevuZamani = :randevuZamani")})
public class MusteriRandevu implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Long id;
    @Basic(optional = false)
    @Column(name = "randevu_zamani")
    @Temporal(TemporalType.TIMESTAMP)
    private Date randevuZamani;
    @JoinColumn(name = "musteri_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Musteri musteri;
    @JoinColumn(name = "sube_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Sube sube;

    public MusteriRandevu() {
    }

    public MusteriRandevu(Long id) {
        this.id = id;
    }

    public MusteriRandevu(Long id, Date randevuZamani) {
        this.id = id;
        this.randevuZamani = randevuZamani;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getRandevuZamani() {
        return randevuZamani;
    }

    public void setRandevuZamani(Date randevuZamani) {
        this.randevuZamani = randevuZamani;
    }

    public Musteri getMusteri() {
        return musteri;
    }

    public void setMusteri(Musteri musteri) {
        this.musteri = musteri;
    }

    public Sube getSube() {
        return sube;
    }

    public void setSube(Sube sube) {
        this.sube = sube;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MusteriRandevu)) {
            return false;
        }
        MusteriRandevu other = (MusteriRandevu) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ronin.model.MusteriRandevu[ id=" + id + " ]";
    }
    
}
